<template>
    <img :src="path" class="mwh sidebarIcon">
</template>
<script>
export default {
    data(){
        return{}
    },
    props:{
        icon:{
            default:'task'
        },
        routePath:{
            required:true
        }
    },
    computed:{
        path(){
            if(this.$route.path==this.routePath) return require(`@/assets/sidebar/${this.icon}-active.png`)
            else return require(`@/assets/sidebar/${this.icon}.png`)
        }
    },
}
</script>
<style lang="scss" scoped>
.sidebarIcon{
    width: 1.5em;
    height: 1.5em;
    margin-right: 20px;
}
</style>